package com.mutual.assistance.media.converter;

import com.mutual.assistance.media.model.dto.MediaFilesDTO;
import com.mutual.assistance.media.model.dto.UploadFileResultDto;
import com.mutual.assistance.media.model.po.MediaFilesPO;
import com.mutual.assistance.media.model.vo.UploadFileParamsVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @author chenyuxin
 * @version 1.0
 * @description 煤资类转换
 * @date 2023/4/23 22:30
 */
@Mapper(componentModel = "spring")
public interface MediaConverterParams {

    @Mapping(target = "url", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "status", ignore = true)
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "filePath", ignore = true)
    @Mapping(target = "fileId", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "bucket", ignore = true)
    @Mapping(target = "auditStatus", ignore = true)
    @Mapping(target = "auditMind", ignore = true)
    MediaFilesPO uploadFileParamsVO2(UploadFileParamsVO uploadFileParamsVO);


    @Mapping(target = "changeTime", source = "updateTime")
    UploadFileResultDto mediaFilesPO2UploadFileResultDto(MediaFilesPO mediaFilesPO);

    @Mapping(target = "username", expression = "java(com.mutual.assistance.media.utils.SecurityUtil.getUser().getUsername())")
    MediaFilesDTO mediaFilesPO2MediaFilesDTO(MediaFilesPO mediaFilesDTO);

    List<MediaFilesDTO> mediaFilesPO2MediaFilesDTOList(List<MediaFilesPO> mediaFilesPOList);
}
